<%--
  Created by IntelliJ IDEA.
  User: wenze-zero
  Date: 2021-06-10-010
  Time: 上午 09:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String username=request.getParameter("username");
    String password=request.getParameter("pwd");
    if(username.equals(password)) {
        session.setAttribute("loginname",username);
        if (application.getAttribute("username") == null) {
            ArrayList users = new ArrayList();
            users.add(request.getParameter("username"));
            application.setAttribute("username", users);
        } else {
            ArrayList users = (ArrayList) application.getAttribute("username");
            users.add(request.getParameter("username"));
            application.setAttribute("username", users);
        }
        response.sendRedirect("test4403.jsp");
    }
    else{
        response.sendRedirect("test4401.jsp");
    }
%>

</body>
</html>